package com.wiki.gds.member.provider.modular.member.service.impl;

import com.wiki.gds.member.facade.member.model.Member;
import com.wiki.gds.member.provider.modular.member.mapper.MemberDao;
import com.wiki.gds.member.provider.modular.member.service.MemberService;
import org.beetl.sql.core.SQLManager;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.core.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberDao memberDao;

    @Autowired
    private SQLManager sqlManager;

    @Override
    public Long insert(Member member) {
        return null;
    }

    @Override
    public Boolean update(Member member) {
        return null;
    }

    @Override
    public Boolean del(Member member) {
        return null;
    }

    @Override
    public Member getById(Long id) {
        return null;
    }

    @Override
    public List<Member> getList(Map map) {
        return null;
    }

    @Override
    public void getPageList(PageQuery query) {

    }

    @Override
    public Long getCount(Member member) {
        return null;
    }

    @Override
    public Member getBySelf(Member member) {
//        Query<User> query = sqlManager.query(User.class);
//        return query.andEq("name",user.getLoginname()).single();
        Query<Member> query=sqlManager.query(Member.class);
        return query.andEq("username",member.getUsername()).single();
    }

    @Override
    public Long saveOrUpdate(Member member) {
        return null;
    }
}
